package org.yangspring.samples.mvc.serviceOracle;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.yangspring.samples.mvc.daoOracle.DBAViewsDAO;
import org.yangspring.samples.mvc.domainOracle.DBAViews;

import java.util.List;

import static java.lang.System.out;

/**
 * Created by franklin on 6/24/2017.
 */

@Service
public class DBAViewsServiceImpl implements DBAViewsService {

    private static final Logger logger = LoggerFactory.getLogger(DBAViewsServiceImpl.class);

    @Autowired
    private DBAViewsDAO dbaViewDao;
//    public void setDbaViewDao(DBAViewsDAO dbaViewDao){
//        this.dbaViewDao = dbaViewDao;
//    }

    @Transactional
    public List<DBAViews> listDbaViews(){
        logger.warn("\nOracle DBAViewsServiceImpl\n");
        return this.dbaViewDao.listDbaViews();
    }

    /*@Transactional
    public List<DBAViews> listDbaViews4Owner(String owner){
        logger.warn("\nOracle DBAViewsServiceImpl for Owner\n");
        return this.dbaViewDao.listDbaViews4Owner(owner);
    }*/

    @Transactional
    public List<DBAViews> listDbaViews4Name(String name){
        logger.warn("\nOracle DBAViewsServiceImpl for Owner\n");
        return this.dbaViewDao.listDbaViews4Name(name);
    }

    @Transactional
    public List<DBAViews> listDbaViews4NameOwner(String owner, String name){
        logger.warn("\nOracle DBAViewsServiceImpl for Name and Owner\n");
        return this.dbaViewDao.listDbaViews4NameOwner(name, owner);
    }

}
